package cn.lycode.generator.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * GeneratorProperty
 * 将 application.properties中 generator下的参数映射给这个类的属性
 */
@Data
@Component
@ConfigurationProperties(prefix = "generator")
@PropertySource("classpath:application.yml")
public class GeneratorConfig {

    // 初始值配置
    private PathProperties path;

    // 全局配置
    private GlobalProperties global;

    // 模块名
    private String moduleName;

    //表名pre_fix
    private String tablePrefix;

    @Data
    public static class GlobalProperties {

        {
            author = "lyCode";
            packages = "cn.lycode";
        }

        // 作者
        private String author;

        // 包名
        private String packages;
    }


    @Data
    public static class PathProperties {

        // 前端项目初始路径
        private String web;

        // 后端项目初始路径
        private String api;
    }

}
